package com.gigi.datageniebackendmaster.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.gigi.datageniebackendmaster.common.BaseResponse;
import com.gigi.datageniebackendmaster.common.IdRequest;
import com.gigi.datageniebackendmaster.model.entity.ChartEntity;
import com.gigi.datageniebackendmaster.model.request.GenChartRequest;
import com.gigi.datageniebackendmaster.model.request.ListChartRequest;
import com.gigi.datageniebackendmaster.model.vo.GenChartVO;
import com.gigi.datageniebackendmaster.model.vo.MyChartVO;
import org.springframework.web.multipart.MultipartFile;

import javax.servlet.http.HttpServletRequest;
import java.io.IOException;

/**
 * <p>
 * 图表 服务类
 * </p>
 *
 * @author Gigi
 * @since 2024-07-21
 */
public interface ChartService extends IService<ChartEntity> {

    /**
     * 生成图表（异步mq）
     *
     * @param request
     * @param file
     * @param httpServletRequest
     * @return
     */
    BaseResponse<Boolean> genChartAsyncMq(GenChartRequest request, MultipartFile file, HttpServletRequest httpServletRequest) throws IOException;

    /**
     * 生成图表（异步）
     *
     * @param request
     * @param file
     * @param httpServletRequest
     * @return
     */
    BaseResponse<Boolean> genChartAsync(GenChartRequest request, MultipartFile file, HttpServletRequest httpServletRequest) throws IOException;

    void handleUpdateError(Long id, String errorMsg);

    /**
     * 生成图表（同步）
     *
     * @param request
     * @param file
     * @param httpServletRequest
     * @return
     */
    BaseResponse<GenChartVO> genChart(GenChartRequest request, MultipartFile file, HttpServletRequest httpServletRequest) throws IOException;

    /**
     * 列表
     *
     * @param request
     * @param httpServletRequest
     * @return
     */
    BaseResponse<MyChartVO> list(ListChartRequest request, HttpServletRequest httpServletRequest);

    /**
     * 删除
     *
     * @param request
     * @param httpServletRequest
     * @return
     */
    BaseResponse<Boolean> del(IdRequest request, HttpServletRequest httpServletRequest);

}
